﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PingPong
{
    public class Pad
    {
        //Constructor of the class
        public Pad(int sizePad)
        {
            size = sizePad;
        }

        //position and size field
        private int[] position = new int[2];
        private int size;

        //property for field position
        public int[] Position
        {
            get
            {
                return this.position;
            }
            set
            {
                this.position = value;
            }
        }

        //property for field size
        public int Size
        {
            get
            {
                return this.size;
            }
            set
            {
                this.size = value;
            }
        }

        /// <summary>
        /// Moves the player up. Second element of the array position for Y direction.
        /// </summary>
        public void MoveUp()
        {
            if (Position[1] > 1)
            {
                Position[1]--;
            }
        }

        /// <summary>
        /// Moves the player down. Second element of the array position for Y direction.
        /// </summary>
        public void MoveDown()
        {
            if (Position[1] < Console.WindowHeight - size-2)
            {
                Position[1]++;
            }
        }
    }
}